﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Web.DynamicData;
using FlexiCommerce.Components;

namespace FlexiCommerce.Web.DynamicData.FieldTemplates
{
    public partial class Hierarchical_Parent : System.Web.DynamicData.FieldTemplateUserControl
    {
        public override void DataBind()
        {
            base.DataBind();
            Category cat = (Category)FieldValue;
            if (cat == null)
            {
                LiteralParentName.Text = "None (ROOT)";
            }
            else
            {
                LiteralParentName.Text = cat.Name;
            }
        }
    }
}
